package parser.nodes;

import java.util.ArrayList;
import java.util.List;

// FormalParameters = FPSection {';' FPSection}
public class FormalParametersNode extends Node {
    private List<FPSectionNode> sections = new ArrayList<>();
    
    public FormalParametersNode(FPSectionNode section) {
        sections.add(section);
    }
    
    public void addSection(FPSectionNode section) {
        sections.add(section);
    }

    public List<FPSectionNode> getSections() {
        return sections;
    }
    
    @Override
    public void print() {
        p("FormalParameters:");
        indent();
        for(FPSectionNode section : sections) {
            section.print();
            p(";");
        }
        unindent();
    }

    @Override
    public void abstractPrint() {
        p("FORMALPARAMS");
        indent();
        for(FPSectionNode section : sections)
            section.abstractPrint();
        unindent();
    }
    
    
}
